﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using XKJ.OAWeb.Application;

namespace XKJ.OAWeb.Api.Controllers
{
    /// <summary>
    /// 导航
    /// </summary>
    [Route("api/[controller]")]
    //授权特性，表示：下面的所有方法都必须登录才能调用
    [Authorize]
    public class NavigationController : ControllerBase
    {
        INavigationService _navigationService;

        public NavigationController(INavigationService navigationService)
        {
            _navigationService = navigationService;
        }
        /// <summary>
        /// 递归
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        //允许匿名访问的特性
        [AllowAnonymous]
        public IActionResult Getlist()
        {
            return Ok(_navigationService.GetList());
        }
    }
}
